import requests
import re

host = 'http://127.0.0.1/'

if __name__ == '__main__':
    print(re.match(r'1[3,4,5,7,8]\d{9}', '11111111111'))
    # session = requests.Session()

    # 注册
    # res = session.post(f'{host}user/register/', data={'mobile': '11111111111', 'password': 123456})
    # print(res.json())

    # 登录
    # res = session.post(f'{host}user/login/',
    #                    data={
    #                        # 'account': '0000000021', 'password': '1234',
    #                        'account': '0000000001', 'password': 'admin',
    #                    }
    #                    )
    # print(res.json())
    # print(session.cookies)

    # 登出
    # res = session.post(f'{host}user/logout/')
    # print(res.json())

    # 在线用户
    # res= session.get(f'{host}user/online_users/')
    # print(res.json())

    # 用户列表
    # res= session.get(f'{host}user/api/user/')
    # print(res.json())

    # 查看用户
    # res=session.get(f'{host}user/api/user/1/')
    # print(res.json())

    # 更新用户
    # res = session.put(f'{host}user/api/user/5/', data={
    #     'username': 'demo',
    #     'password': 'demo',
    # })
    # print(res.json())

    # 删除用户
    # res = session.delete(f'{host}user/api/user/5/')
    # print(res.json())

    # 更新用户实时位置
    # res = session.post(f'{host}user/update_location/', data={
    #     'longitude': '60',
    #     'latitude': '60',
    # })
    # print(res.json())

    # 获取临近用户
    # res = session.get(f'{host}user/nearby_users/?distance=100000')
    # print(res.json())

    # 生成二维码
    # from MyQR import myqr
    # myqr.run(words='1234',save_name='demo.jpg')
